
#region using statements

using NGen;
using NGen.Managers.Audio;
using NGen.Managers.Collision;
using NGen.Managers.GUI;
using NGen.Managers.GameObject;
using NGen.Managers.GameState;
using NGen.Managers.Input;
using NGen.Managers.Pathfinding;
using NGen.Systems.Graphics;

using Psych.States;
#endregion

namespace Psych
{
    internal static class Program
    {
        /// <summary>
        /// 	The main entry point for the Game.
        /// </summary>
        private static void Main()
        {
            using (var game = new GameEngine())
            {
                game.IsMouseVisible = true;

                //set the resolution
                GameEngine.GraphicsDeviceManager.PreferredBackBufferWidth = 800;
                GameEngine.GraphicsDeviceManager.PreferredBackBufferHeight = 600;

                SetupManagers();

                //we want to start in the menu state
                GameEngine.GetService<IManagerGameState>().StartingState = new GameStateMenu();

                game.Run();
            }
        }

        /// <summary>
        /// 	Creats the managers, register them as services, add them to the
        /// 	game engine to be automatically updated
        /// </summary>
        private static void SetupManagers()
        {
            GameEngine.GameServices.AddService(typeof(IManagerGameState), new ManagerGameState());
            GameEngine.AddManager(GameEngine.GetService<IManagerGameState>());
            GameEngine.GameServices.AddService(typeof(IManagerAudio2D), new ManagerAudio2D());
            GameEngine.AddManager(GameEngine.GetService<IManagerAudio2D>());
            GameEngine.GameServices.AddService(typeof(IManagerGameObjects), new ManagerGameObjects());
            GameEngine.AddManager(GameEngine.GetService<IManagerGameObjects>());
            GameEngine.GameServices.AddService(typeof(IManagerGUI), new ManagerGUI());
            GameEngine.AddManager(GameEngine.GetService<IManagerGUI>());
            GameEngine.GameServices.AddService(typeof(IManagerInput), new ManagerInput());
            GameEngine.AddManager(GameEngine.GetService<IManagerInput>());
            GameEngine.GameServices.AddService(typeof(IManagerCollision2D), new ManagerCollision2D());
            GameEngine.AddManager(GameEngine.GetService<IManagerCollision2D>());
            GameEngine.GameServices.AddService(typeof(IManagerPathfinding), new ManagerPathfinding());
        }
    }
}


